package com.forum.domain;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.HashSet;
import java.util.Set;

/**
 * Topic entity. @author MyEclipse Persistence Tools
 */

public class Topic implements java.io.Serializable {

        // Fields

        private Integer id;
        private Category category;
        private Groups groups;
        private User user;
        private String title;
        private String label;
        private Timestamp createtime;
        private Integer replycount;
        private Integer viewcount;
        private String content;
        private Boolean visibility;
        private Set reminds = new HashSet(0);
        private Set replies = new HashSet(0);
        private Set ucts = new HashSet(0);

        // Constructors

        /** default constructor */
        public Topic() {
        }

        /** minimal constructor */
        public Topic(Category category, Groups groups, User user, String title,
                        String label, Timestamp createtime, String content,
                        Boolean visibility) {
                this.category = category;
                this.groups = groups;
                this.user = user;
                this.title = title;
                this.label = label;
                this.createtime = createtime;
                this.content = content;
                this.visibility = visibility;
        }

        /** full constructor */
        public Topic(Category category, Groups groups, User user, String title,
                        String label, Timestamp createtime, Integer replycount,
                        Integer viewcount, String content, Boolean visibility, Set reminds,
                        Set replies, Set ucts) {
                this.category = category;
                this.groups = groups;
                this.user = user;
                this.title = title;
                this.label = label;
                this.createtime = createtime;
                this.replycount = replycount;
                this.viewcount = viewcount;
                this.content = content;
                this.visibility = visibility;
                this.reminds = reminds;
                this.replies = replies;
                this.ucts = ucts;
        }

        // Property accessors

        public Integer getId() {
                return this.id;
        }

        public void setId(Integer id) {
                this.id = id;
        }

        public Category getCategory() {
                return this.category;
        }

        public void setCategory(Category category) {
                this.category = category;
        }

        public Groups getGroups() {
                return this.groups;
        }

        public void setGroups(Groups groups) {
                this.groups = groups;
        }

        public User getUser() {
                return this.user;
        }

        public void setUser(User user) {
                this.user = user;
        }

        public String getTitle() {
                return this.title;
        }

        public void setTitle(String title) {
                this.title = title;
        }

        public String getLabel() {
                return this.label;
        }

        public void setLabel(String label) {
                this.label = label;
        }

        public Timestamp getCreatetime() {
                return this.createtime;
        }
public String getDateTime() {
                
                SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
                
                return df.format(this.createtime);
        }

        public void setCreatetime(Timestamp createtime) {
                this.createtime = createtime;
        }

        public Integer getReplycount() {
                return this.replycount;
        }

        public void setReplycount(Integer replycount) {
                this.replycount = replycount;
        }

        public Integer getViewcount() {
                return this.viewcount;
        }

        public void setViewcount(Integer viewcount) {
                this.viewcount = viewcount;
        }

        public String getContent() {
                return this.content;
        }

        public void setContent(String content) {
                this.content = content;
        }

        public Boolean getVisibility() {
                return this.visibility;
        }

        public void setVisibility(Boolean visibility) {
                this.visibility = visibility;
        }

        public Set getReminds() {
                return this.reminds;
        }

        public void setReminds(Set reminds) {
                this.reminds = reminds;
        }

        public Set getReplies() {
                return this.replies;
        }

        public void setReplies(Set replies) {
                this.replies = replies;
        }

        public Set getUcts() {
                return this.ucts;
        }

        public void setUcts(Set ucts) {
                this.ucts = ucts;
        }

}